package apiUtils.apis.account;

import android.content.Context;

import org.json.JSONException;

import apiUtils.params.Params;
import constant.ApiConstants;

/**
 * Created by Joe on 2017/7/20 0020 10:31.
 */

public class VerifySMSAPI extends BaseAccountAPI {
    private static final String tag = "VerifySMSAPI";
    private static final String url = ApiConstants.DOMAIN_NAME + "verifyCode";
    private String mVerifyCode;
    private String mDeviceId;
    private String mDeviceName;

    public VerifySMSAPI(Context context) {
        super(context);
    }

    public void verifySMSAccount(String subType, String accountId, String verifyCode, String deviceId,
                                 String deviceName, final BaseAccountAPI.Listener listener) {
        mSubType = subType;
        mUserAccount = accountId;
        mVerifyCode = verifyCode;
        mDeviceId = deviceId;
        mDeviceName = deviceName;
        post(tag, url, listener);
    }

    @Override
    protected Params initParams() throws JSONException {
        initAccountParams();
        mApiParams.put("accountId", mUserAccount);
        mApiParams.put("verifyCode", mVerifyCode);
        mApiParams.put("deviceId", mDeviceId);
        mApiParams.put("deviceName", mDeviceName);
        return mApiParams;
    }
}
